import time

from selenium import webdriver

from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select

driver = webdriver.Chrome()
driver.maximize_window()
driver.get('D://test/1.html')
driver.implicitly_wait(10)
# #点击确认/取消按钮弹窗
# driver.find_element(By.XPATH,'/html/body/div/input[3]').click()
# #点击提示弹框
# driver.find_element(By.XPATH,'/html/body/div/input[2]').click()
#点击输入文本的弹窗
driver.find_element(By.XPATH,'/html/body/div/input[1]').click()

#切换到弹窗 并点击确定
al=driver.switch_to.alert
time.sleep(2)
#在弹框中输入指定的值
al.send_keys("1")
#并点击确定
al.accept()
#点击取消
# al.dismiss()